days=30
while [ $days -le 49 ]
do 
    datestr=`date "-d $days days ago" +%Y%m%d` 
    echo $datestr
    hadoop fs -get hdfs://10.177.149.230:9000/data/backup_center/webqq/$datestr/10.133.4.164/data/log_cgi-android_msg-tomcat?.log.201* /data/java/logs/cgi-android164/
    ((days += 1))
done
#exit 0
cd /data/java/logs/cgi-android164/
for i in *.tgz;
do tar -xvf $i;
echo $i;
rm $i;
done
mv data/java/logs/cgi-android/* .
rm -r data
